import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/', //这个表示的是根目录，即一进入的页面
    redirect: 'china' //设置页面一进来就显示的页面，即重定向到china组件，这里写的内容是对应组将的component的值
  },

  {
    path: '/about',
    name: 'about',
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/china',
    name: 'china',
    component: () => import(/* webpackChunkName: "about" */ '../views/Map/china.vue')
  },
  {
    path: '/province',
    name: 'province',
    component: () => import(/* webpackChunkName: "about" */ '../views/Map/province.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
